import Views from "../../views/index.vue";
// import { createNameComponent } from "../createNode";

const route = [
    {
        path: "/communication",
        name: "communication",
        component: Views,
        redirect: "/communication/parentToChild",
        meta: { title: "组件通信", icon: "el-icon-table-lamp" },
        children: [
            {
                path: "parentToChild",
                name: "parentToChild",
                // component: createNameComponent(() => import("@/views/main/community/qq.vue")),
                component: () => import("../../pages/componentCommunication/parentToChild/index.vue"),
                meta: { title: "父传子" },
            },
            {
                path: "childToParent",
                name: "childToParent",
                component: () => import("../../pages/componentCommunication/childToParent/index.vue"),
                meta: { title: "子传父" },
            },
            {
                path: "provideInject",
                name: "provideInject",
                component: () => import("../../pages/componentCommunication/provideInject/index.vue"),
                meta: { title: "祖孙通信" },
            },
            {
                path: "vmodel",
                name: "vmodel",
                component: () => import("../../pages/componentCommunication/vmodel/index.vue"),
                meta: { title: "v-model通信" },
            },
            {
                path: "ref",
                name: "ref",
                component: () => import("../../pages/componentCommunication/ref/index.vue"),
                meta: { title: "ref通信" },
            },
            {
                path: "attrs",
                name: "attrs",
                component: () => import("../../pages/componentCommunication/attrs/index.vue"),
                meta: { title: "attrs通信" },
            },
        ],
    },
];

export default route;
